package com.jmz.apt.api.common;

import com.jmz.apt.api.dto.impl.AdminTokenDto;

/**
 * Created by fanglexue on 2019/10/25.
 */
public class SecurityContextHolder {
    public static final ThreadLocal<AdminTokenDto> agentHolder=new ThreadLocal<>();

    public static void addAgent(AdminTokenDto agent){
        agentHolder.set(agent);
    }

    public static AdminTokenDto getAgent(){
        return agentHolder.get();
    }
    public static void remove(){
        agentHolder.remove();
    }
}
